using System.Collections.Generic;
using System.Linq;
using AllIsWell.Core.Models;

namespace AllIsWell.Persistance.Ef
{
    public class DestinyRepository : IDestinyRepository
    {
        private readonly MyDiary _myDiary;

        public DestinyRepository(MyDiary myDiary)
        {
            _myDiary = myDiary;
        }

        public IEnumerable<Destiny> Destinies
        {
            get { return _myDiary.Destinies; }
        }

        public Destiny GetDestiny(int destinyId)
        {
            return _myDiary.Destinies.First(destiny => destiny.Id == destinyId);
        }
    }
}